import request from '@/utils/request'

const api_name = "/admin/el/qu"

export default {   
    getPageList(page,limit,elQuQueryVo){
        return request({
            url:`${api_name}/${page}/${limit}`, 
            method: 'get',      //请求方式
            params: elQuQueryVo //参数
          })
    },
    //获取全部
    getAll(elQuQueryVo){
      return request({
          url:`${api_name}`, 
          method: 'get',      //请求方式
          params: elQuQueryVo //参数
        })
  },
    //删除
    DeleteQu(id){
      return request({
        url:`${api_name}/${id}`, 
        method: 'delete',      //请求方式
      })
    },

    //从题库中删除某个题库
    DeleteQuToRepo(repoId,quId){
        return request({
          url:`${api_name}/DeleteQuToRepo/${repoId}/${quId}`, 
          method: 'delete',      //请求方式
        })
      },

      //批量删除
    DeleteQuList(idList){
        return request({
          url:`${api_name}/batchRemove`, 
          method: 'delete',      //请求方式
          data: idList
        })
      },

    //从题库中批量删除
    DeleteQusToRepo(repoId,idList){
        return request({
          url:`${api_name}/batchRemove/${repoId}`, 
          method: 'delete',      //请求方式
          data: idList
        })
      },
    //查询所有题库名称和id
    GetRepoAndId(){
        return request({
          url:`${api_name}/GetRepoAndId`, 
          method: 'get',
        })
    },
    //查询单个
    SelectByID(id){
      return request({
        url:`${api_name}/${id}`, 
        method: 'get',
      })
    },
    //更新
    Updata(ElQu){
      return request({
        url:`${api_name}`, 
        method: 'put',
        data: ElQu
      })
    },
    //添加
    Add(ElQu){
      return request({
        url:`${api_name}`, 
        method: 'post',
        data: ElQu
      })
    },
    //某个题目添加到某个题库
    AddQuToRepo(repoId,quId){
        return request({
            url:`${api_name}/AddQuToRepo/${repoId}/${quId}`, 
            method: 'get',
          })
    }

    
}